package kuang.juc.single;


//饿汉试单例模式
public class Hungry {
    //构造器私有，防止外部实例化
    private Hungry() {

    }
    //只有一个对象
    private final static Hungry HUNGRY=new Hungry();

    public Hungry getInstance(){
        return HUNGRY;
    }
}
